<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <!-- 作用：内容分发 -->
      <!-- 子组件标签中间的内容回去替换子组件里面的<slot></slot>标签 -->
      <!-- 分发文本，标签，组件 -->
      <h3>插槽</h3>
      <child>
        <span>123</span>
        <child2></child2>
      </child>
    </div>

    <script src="../Vue.js"></script>
    <script>
      const Child2 = {
        template: `
          <div>
            child2
          </div>
        `,
      };

      const Child = {
        template: `
          <div>
            child - <slot></slot>
          </div>
        `,
      };

      new Vue({
        el: "#app",
        data: {},
        components: {
          Child,
          Child2,
        },
      });
    </script>
  </body>
</html>
